//处理路由
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const Index = () => import('../views/Index/index')
const Category = () => import('../views/Category/index')
const ShopCart = () => import('../views/ShopCart/index')
const Profile = () => import('../views/Profile/index')
const Search = () => import('../views/Search/index')
const List = () => import('../views/Goods/list')
const Detail = () => import('../views/Goods/detail')
const ConfirmOrder = () => import('../views/Order/confirmOrder')
const ConfirmPay = () => import('../views/Order/confirmPay')
const MyOrder = () => import('../views/Order/myOrder')
const Setting = () => import('../views/User/setting')
const ManageAddress = () => import('../views/Address/manageAddress')
const UpdateAddress = () => import('../views/Address/updateAddress')
const Welcome = () => import('../views/Login/Welcome')
const TelInput = () => import('../views/Login/telInput.vue')
const SendVerify = () => import('../views/Login/sendVerify.vue')
const router = new VueRouter({
  routes: [{
      path: '/',
      name: 'Index',
      component: Index
    },
    {
      path: '/category',
      name: 'Category',
      component: Category
    },
    {
      path: '/cart',
      name: 'ShopCart',
      component: ShopCart
    },
    {
      path: '/profile',
      name: 'Profile',
      component: Profile
    },
    {
      path: '/search',
      name: 'Search',
      component: Search
    },
    {
      path: '/goods/list',
      name: 'List',
      component: List
    },
    {
      path: '/goods/detail/:id',
      name: 'Detail',
      component: Detail
    },
    {
      path: '/order/confirmOrder',
      name: 'ConfirmOrder',
      component: ConfirmOrder
    },
    {
      path: '/order/myOrder',
      name: 'MyOrder',
      component: MyOrder
    },
    {
      path: '/order/confirmPay',
      name: 'ConfirmPay',
      component: ConfirmPay
    },
    {
      path: '/user/setting',
      name: 'Setting',
      component: Setting
    },
    {
      path: '/address/manage',
      name: 'ManageAddress',
      component: ManageAddress
    },
    {
      path: '/address/update',
      name: 'UpdateAddress',
      component: UpdateAddress
    },
    {
      path:'/login/welcome',
      name:'Welcome',
      component:Welcome
    },
    {
      path:'/login/reg',
      name:'TelInput',
      component:TelInput
    },
    {
      path:'/login/sendVerify',
      name:'SendVerify',
      component:SendVerify
    }
  ],
  mode: "history"
})
export default router